<template>
  <div>
    <el-form :inline="true">
      <el-form-item>
        <c-select
          :options="enumAttach"
          v-model="params['is_comm_used.eq']"
          placeholder="系统分类"
        ></c-select>
      </el-form-item>
      <el-form-item>
        <el-button @click="getData()">查询</el-button>
      </el-form-item>
    </el-form>
    <c-table
      border
      class="table-sm"
      v-loading="loading"
      :columns="tableColumns"
      :data="tableData"
    ></c-table>
  </div>
</template>

<script>
import { enumAttach } from '@/cadmin/views/system/attach/index'
export default {
  data() {
    return {
      enumAttach,
      loading: false,
      params: {
        'is_comm_used.eq': 'bank',
      },
      tableName: 'credit_attachment_tags',
      order: {
        order_num: 'asc',
      },
      tableData: [],
      tableColumns: [
        { attrs: { label: '序号', prop: 'order_num', align: 'center', width: '90px' } },
        { attrs: { label: '标签名称', prop: 'tag_name' } },
      ],
      name: '',
    }
  },

  created() {
    this.getData()
  },
  methods: {
    getData(index = 1) {
      this.loading = true
      this.params.index = index
      this.$api
        .getData(this.$serviceName, this.tableName, {}, this.order)
        .then(res => {
          this.tableData = res?.data ?? []
        })
        .finally(() => {
          this.loading = false
        })
    },
  },
}
</script>
<style lang="scss" scoped></style>
